{% extends "profiles/base_profile_edit.html" %}
{% load static %}
{% load i18n %}

{% block profile-admin-gold-edit %}active{% endblock %}

{% block title %}{% trans "Gold Projects" %}{% endblock %}


{% block edit_content %}

  <h3>{% trans "Gold Projects" %}</h3>
  <p>
    {% blocktrans trimmed %}
      Gold members may completely remove advertising for all visitors to their projects.
    {% endblocktrans %}
  </p>

  <ul class="donate-about">
    <li>{% trans 'For small businesses or personal projects, we ask for $5 per month to remove ads from a project.' %}</li>
    <li>{% trans 'For corporate supported open source projects, we ask for a $50 membership in order to cover our support and operations costs.' %}</li>
  </ul>

  <h3>{% trans 'Ad-free projects' %}</h3>

  <div class="module-gold-projects">
    <div class="module-list">
      <div class="module-list-wrapper">
        <ul>
          {% for project in projects %}
          <li class="module-item">
            <a class="module-item-title" href="{{ project.get_absolute_url }}">
              {{ project.name }}
            </a>
            <ul class="module-item-menu">
              <li>
                <form method="post" action="{% url "gold_projects_remove" project.slug %}">
                  {% csrf_token %}
                  <input type="submit" title="{% trans 'Remove Ad-Free Status' %}" value="{% trans 'Remove' %}">
                </form>
              </li>
            </ul>
          </li>
          {% empty %}
          <li class="module-item">
            <p class="quiet">
              {% trans 'No projects are currently ad-free.' %}
            </p>
          </li>
          {% endfor %}
        </ul>
      </div>
    </div>
  </div>

  <h3>{% trans "Make a project ad-free" %}</h3>
  {% if gold_user.num_supported_projects > projects|length %}
    <p>
      {% trans "Choose which project you would like to make ad-free." %}
    </p>
    <form method="post" action=".">{% csrf_token %}
      {{ form.as_p }}
      <p>
        <input type="submit" value="{% trans "Make Project Ad-Free" %}">
      </p>
    </form>
  {% else %}
    <p>
      {% blocktrans trimmed with gold_level=gold_user.get_level_display gold_projects_count=gold_user.num_supported_projects %}
        You can't make any more projects ad-free with your current Gold membership of {{ gold_level }}.
        You can either increase the level of your membership or change which projects you make ad-free.
      {% endblocktrans %}
    </p>
  {% endif %}

{% endblock %}
